package task09;

/**
 * @author Administrator
 */
public class Tesk5 {
    public static void main(String[] args) {
        int sum = 0;
        for (int i=1;i<=1000;i++) {
            if (i%3==2 & i%5==3 & i%7==2) {
                sum = sum+1;
          }
        }
        System.out.println(sum);
    }
}